/*
 * 
 * LegendShop 多用户商城系统
 * 
 *  版权所有,并保留所有权利。
 * 
 */
package com.legendshop.oa.dao;

import java.util.Date;
import java.util.List;

import com.legendshop.dao.Dao;
import com.legendshop.dao.support.PageSupport;
import com.legendshop.oa.dto.Select2Dto;
import com.legendshop.oa.dto.TaskAssignDto;
import com.legendshop.oa.dto.TaskCancelDto;
import com.legendshop.oa.dto.TaskCloseDto;
import com.legendshop.oa.dto.TaskEstimateDto;
import com.legendshop.oa.dto.TaskFinishDto;
import com.legendshop.oa.dto.TaskQueryDto;
import com.legendshop.oa.dto.TaskStartDto;
import com.legendshop.oa.model.Task;
import com.legendshop.oa.security.UserDetail;

/**
 * The Class TaskDao. Dao接口
 */
public interface TaskDao extends Dao<Task, Long> {

	/**
	 * 根据Id获取
	 */
	Task getTask(Long id);
	
	/**
	 * 根据Id获取
	 */
	Task getTaskById(Long id);

	/**
	 * 删除
	 */
	int deleteTask(Task task);

	/**
	 * 保存
	 */
	Long saveTask(Task task,UserDetail ud);

	/**
	 * 更新
	 */
	int updateTask(Task task);

	PageSupport<Task> getTask(TaskQueryDto taskQueryDto);

	boolean assignUpdateTask(Long taskId, TaskAssignDto taskAssignDto, UserDetail ud);

	boolean startUpdateTask(Long taskId, TaskStartDto taskStartDto, UserDetail ud);

	boolean finishUpdateTask(Long taskId, TaskFinishDto taskFinishDto, UserDetail ud);

	boolean closeUpdateTask(Long taskId, TaskCloseDto taskCloseDto, UserDetail ud);

	boolean cancelUpdateTask(Long taskId, TaskCancelDto taskCancelDto, UserDetail ud);

	boolean saveTaskEstimate(Task task, List<TaskEstimateDto> taskEstimateList, UserDetail ud);

	List<Select2Dto> queryList(Long projectId, Date startDate, Date endDate, String userName, String q, Integer pageSize, Integer currPage);

	int taskCount(Long projectId, Date startDate, Date endDate, String userName, String q);

	boolean saveTaskEstimate(Task task, TaskEstimateDto taskEstimate, UserDetail ud);

}
